import { axios } from '@/utils/request'

const api = {
  student: '/student/student'
}

export function getStudentInfo () {
  return axios({
    url: api.student + '/get',
    method: 'get'
  })
}

export function getStudentList (parameter) {
  return axios({
    url: api.student + '/list',
    method: 'get',
    params: parameter
  })
}

export function saveStudent (parameter) {
  return axios({
    url: api.student + (parameter.studentId > 0 ? '/update' : '/save'),
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function updateBatchCount (parameter) {
  return axios({
    url: api.student + '/updateBatchCount',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function updateBatchStudent (parameter) {
  return axios({
    url: api.student + '/updateBatch',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

export function delStudent (parameter) {
  return axios({
    url: api.student + '/remove',
    method: 'post',
    params: parameter
  })
}

export const studentExport = api.student + '/export'
